home *** CD-ROM | disk | FTP | other *** search
- Subject: v24i013: RCS source control system, Patch1
- Newsgroups: comp.sources.unix
- Approved: rsalz@uunet.UU.NET
- X-Checksum-Snefru: fa066b6b 4bf25843 4ed1a085 922c2807
-
- Submitted-by: Paul Eggert <eggert@twinsun.com>
- Posting-number: Volume 24, Issue 13
- Archive-name: rcs/patch1
-
- In the distribution of RCS 5.5 in comp.sources.unix, the file src/rcstest
- is missing. (This file is mentioned in README and src/Makefile.)
-
- Also, PACKNOTES mentions the wrong extension for rcs.ms.*, and doesn't
- mention that COPYING should be linked to src/COPYING.
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then feed it
- # into a shell via "sh file" or similar. To overwrite existing files,
- # type "sh file -c".
- # The tool that generated this appeared in the comp.sources.unix newsgroup;
- # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
- # Contents: PACKNOTES src/rcstest
- # Wrapped by rsalz@litchi.bbn.com on Mon Feb 25 15:58:19 1991
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- echo If this archive is complete, you will see the following message:
- echo ' "shar: End of archive."'
- if test -f 'PACKNOTES' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'PACKNOTES'\"
- else
- echo shar: Extracting \"'PACKNOTES'\" \(162 characters\)
- sed "s/^X//" >'PACKNOTES' <<'END_OF_FILE'
- X# "rcs.ms" was split into 2 parts; to create it, do
- X cat rcs.ms.* >rcs.ms
- X# "src/COPYING" should be a copy of "COPYING"; to create it, do
- X ln COPYING src/COPYING
- END_OF_FILE
- if test 162 -ne `wc -c <'PACKNOTES'`; then
- echo shar: \"'PACKNOTES'\" unpacked with wrong size!
- fi
- # end of 'PACKNOTES'
- fi
- if test -f 'src/rcstest' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'src/rcstest'\"
- else
- echo shar: Extracting \"'src/rcstest'\" \(8157 characters\)
- sed "s/^X//" >'src/rcstest' <<'END_OF_FILE'
- X#!/bin/sh
- X
- X# Test RCS's functions.
- X
- X# Test RCS by creating files a.* and a.c,v (or RCS/a.c,v).
- X# If all goes well, output nothing, and remove the temporary files.
- X# Otherwise, send a message to standard output.
- X# Exit status is 0 if OK, 1 if an RCS bug is found, and 2 if scaffolding fails.
- X# With the -v option, output more debugging info.
- X
- X# If diff outputs `No differences encountered' when comparing identical files,
- X# then rcstest may also output these noise lines; ignore them.
- X
- X# The current directory must be readable, writable, and searchable,
- X# and similarly for ./RCS if it exists.
- X# The RCS commands are searched for in the PATH as usual.
- X
- X# $Id: rcstest,v 5.3 1990/09/20 02:38:57 eggert Exp $
- X
- X
- X# Copyright 1990 by Paul Eggert
- X# Distributed under license by the Free Software Foundation, Inc.
- X#
- X# This file is part of RCS.
- X#
- X# RCS is free software; you can redistribute it and/or modify
- X# it under the terms of the GNU General Public License as published by
- X# the Free Software Foundation; either version 1, or (at your option)
- X# any later version.
- X#
- X# RCS is distributed in the hope that it will be useful,
- X# but WITHOUT ANY WARRANTY; without even the implied warranty of
- X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- X# GNU General Public License for more details.
- X#
- X# You should have received a copy of the GNU General Public License
- X# along with RCS; see the file COPYING. If not, write to
- X# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
- X#
- X# Report problems and direct all questions to:
- X#
- X# rcs-bugs@cs.purdue.edu
- X
- Xcase $1 in
- X-v) q=; set -x;;
- X'') q=-q;;
- X*) echo >&2 "$0: usage: $0 [-v]"; exit 2
- Xesac
- X
- Xif test -d RCS
- Xthen R=RCS/
- Xelse R=
- Xfi
- X
- Xrm -f a.* ${R}a.c,v &&
- Xecho 1.1 >a.11 &&
- Xecho 1.1.1.1 >a.1111 &&
- Xecho 1.2 >a.12 &&
- Xrm -f a.c ${R}a.c,v || { echo "#initialization failed"; exit 1; }
- X
- Xrcs -i -L -ta.11 $q a.c &&
- X<${R}a.c,v || { echo "#rcs -i -L failed"; exit 1; }
- X
- Xrlog a.c >/dev/null || { echo "#rlog failed on empty RCS file"; exit 1; }
- Xrm -f ${R}a.c,v || exit 2
- X
- Xcp a.11 a.c &&
- Xci -ta.11 -mm $q a.c &&
- X<${R}a.c,v &&
- Xrcs -L $q a.c || { echo "#ci+rcs -L failed"; exit 1; }
- Xtest ! -f a.c || { echo "#ci did not remove working file"; exit 1; }
- Xfor l in '' '-l'
- Xdo
- X co $l $q a.c &&
- X test -f a.c || { echo '#co' $l did not create working file; exit 1; }
- X diff -c a.11 a.c || { echo '#ci' followed by co $l is not a no-op; exit 1; }
- Xdone
- X
- Xcp a.12 a.c &&
- Xci -mm $q a.c &&
- Xco $q a.c &&
- Xdiff -c a.12 a.c || { echo "#ci+co failed"; exit 1; }
- X
- Xco -r1.1 $q a.c &&
- Xdiff -c a.11 a.c || { echo "#can't retrieve first revision"; exit 1; }
- X
- Xrm -f a.c &&
- Xcp a.1111 a.c &&
- Xci -r1.1.1 -mm $q a.c &&
- Xco -r1.1.1.1 $q a.c &&
- Xdiff -c a.1111 a.c || { echo "#branches failed"; exit 1; }
- X
- Xco -l $q a.c &&
- Xci -f -mm $q a.c &&
- Xco -r1.3 $q a.c &&
- Xdiff -c a.12 a.c || { echo "#(co -l; ci -f) failed"; exit 1; }
- X
- Xco -l $q a.c &&
- Xecho 1.4 >a.c &&
- Xci -l -mm $q a.c &&
- Xecho error >a.c &&
- Xci -mm $q a.c || { echo "#ci -l failed"; exit 1; }
- X
- Xco -l $q a.c &&
- Xecho 1.5 >a.c &&
- Xci -u -mm $q a.c &&
- X<a.c || { echo "#ci -u didn't create a working file"; exit 1; }
- Xrm -f a.c &&
- Xecho error >a.c || exit 2
- Xci -mm $q a.c 2>/dev/null && { echo "#ci -u didn't unlock the file"; exit 1; }
- X
- Xrm -f a.c &&
- Xrcs -l $q a.c &&
- Xco -u $q a.c || { echo "#rcs -l + co -u failed"; exit 1; }
- Xrm -f a.c &&
- Xecho error >a.c || exit 2
- Xci -mm $q a.c 2>/dev/null && { echo "#co -u didn't unlock the file"; exit 1; }
- X
- Xrm -f a.c &&
- Xcp a.11 a.c &&
- Xco -f $q a.c || { echo "#co -f failed"; exit 1; }
- Xdiff -c a.11 a.c >/dev/null && { echo "#co -f had no effect"; exit 1; }
- X
- Xco -p1.1 $q a.c >a.t &&
- Xdiff -c a.11 a.t || { echo "#co -p failed"; exit 1; }
- X
- Xfor n in n N
- Xdo
- X rm -f a.c &&
- X co -l $q a.c &&
- X echo $n >a.$n &&
- X cp a.$n a.c &&
- X ci -${n}n -mm $q a.c &&
- X co -rn $q a.c &&
- X diff -c a.$n a.c || { echo "#ci -$n failed"; exit 1; }
- Xdone
- X
- Xme=${LOGNAME-${USER-`who am i | sed 's/ .*//; s/.*!//'`}} || exit 2
- Xdate=`date -u 2>/dev/null || TZ=GMT date` || exit 2
- Xset $date
- Xcase $2 in
- XJan) m=01;; Feb) m=02;; Mar) m=03;; Apr) m=04;; May) m=05;; Jun) m=06;;
- XJul) m=07;; Aug) m=08;; Sep) m=09;; Oct) m=10;; Nov) m=11;; Dec) m=12;;
- X*) echo >&2 "$0: $2: unknown month name"; exit 2
- Xesac
- Xcase $3 in
- X?) d=0$3;;
- X*) d=$3
- Xesac
- XD=$6/$m/$d
- XT=$4
- X: ${PWD=`pwd`} &&
- Xco -l $q a.c &&
- Xsed 's/@/$/g' <<EOF >a.kv &&
- X@Author: w @
- X@Date: $D $T @
- X@Header: $PWD/${R}a.c,v 2.1 $D $T w s @
- X@Id: a.c,v 2.1 $D $T w s @
- X@Locker: @
- X@Log: a.c,v @
- X * Revision 2.1 $D $T w
- X * m
- X *
- X@RCSfile: a.c,v @
- X@Revision: 2.1 @
- X@Source: $PWD/${R}a.c,v @
- X@State: s @
- XEOF
- Xsed 's/:.*\$/$/' a.kv >a.k &&
- Xsed 's/w s \$$/w s '"$me"' $/; s/[$]Locker: /&'"$me/" a.kv >a.kvl &&
- Xsed '/^\$/!d; s/\$$/: old $/' a.k >a.o &&
- Xsed 's/\$[^ ]*: //; s/ \$//' a.kv >a.v &&
- Xcp a.o a.c &&
- Xci -d"$date" -ss -ww -u2.1 -mm $q a.c &&
- Xdiff -c a.kv a.c || { echo "#keyword expansion failed"; exit 1; }
- Xco -p -ko $q a.c >a.oo &&
- Xdiff -c a.o a.oo || { echo "#co -p -ko failed"; exit 1; }
- Xcp a.kv a.o || exit 2
- Xrcs -o2.1 $q a.c &&
- Xrcs -l $q a.c &&
- Xci -k -u $q a.c &&
- Xdiff -c a.kv a.c || { echo "#ci -k failed"; exit 1; }
- Xsed '/^[^$]/d' a.kv >a.i &&
- Xident a.c >a.i1 &&
- Xsed '1d; s/^[ ]*//' a.i1 >a.i2 &&
- Xdiff -c a.i a.i2 || { echo "#ident failed"; exit 1; }
- X
- Xrcs -i $q a.c 2>/dev/null && { echo "#rcs -i permitted existing file"; exit 1; }
- X
- Xco -l $q a.c &&
- Xecho 2.2 >a.c &&
- Xci -mm $q a.c &&
- Xecho 1.1.1.2 >a.c &&
- Xrcs -l1.1.1 $q a.c &&
- Xci -r1.1.1.2 -mm $q a.c &&
- Xrcs -b1.1.1 $q a.c &&
- Xtest " `co -p $q a.c`" = ' 1.1.1.2' || { echo "#rcs -b1.1.1 failed"; exit 1; }
- Xrcs -b $q a.c &&
- Xtest " `co -p $q a.c`" = ' 2.2' || { echo "#rcs -b failed"; exit 1; }
- X
- Xecho 2.3 >a.c || exit 2
- Xrcs -U $q a.c || { echo "#rcs -U failed"; exit 1; }
- Xci -mm $q a.c || { echo "#rcs -U didn't unset strict locking"; exit 1; }
- Xrcs -L $q a.c || { echo "#rcs -L failed"; exit 1; }
- Xecho error >a.c || exit 2
- Xci -mm $q a.c 2>/dev/null && { echo "#ci retest failed"; exit 1; }
- X
- Xrm -f a.c &&
- Xrcs -nN:1.1 $q a.c &&
- Xco -rN $q a.c &&
- Xdiff -c a.11 a.c || { echo "#rcs -n failed"; exit 1; }
- X
- Xrcs -NN:2.1 $q a.c &&
- Xco -rN $q a.c &&
- Xdiff -c a.kv a.c || { echo "#rcs -N failed"; exit 1; }
- X
- Xco -l $q a.c &&
- Xrcs -c':::' $q a.c &&
- Xecho '$''Log$' >a.c &&
- Xci -u -mm $q a.c &&
- Xtest " `sed '$!d' a.c`" = ' :::' || { echo "#rcs -c failed"; exit 1; }
- X
- Xrcs -o2.2- $q a.c &&
- Xco $q a.c &&
- Xdiff -c a.kv a.c || { echo "#rcs -o failed"; exit 1; }
- X
- Xrcsdiff -r1.1 -r2.1 $q a.c >a.0
- Xcase $? in 1) ;; *) echo "#rcsdiff bad status"; exit 1; esac
- Xdiff a.11 a.kv >a.1
- Xdiff a.0 a.1 || { echo "#rcsdiff failed"; exit 1; }
- X
- Xrcs -l2.1 $q a.c || { echo "#rcs -l2.1 failed"; exit 1; }
- Xfor i in k kv kvl o v
- Xdo
- X rm -f a.c &&
- X cp a.$i a.c &&
- X rcsdiff -k$i -c $q a.c || { echo "#rcsdiff -k$i failed"; exit 1; }
- Xdone
- Xco -p1.1 -ko $q a.c >a.t &&
- Xdiff -c a.11 a.t || { echo "#co -p1.1 -ko failed"; exit 1; }
- Xrcs -u2.1 $q a.c || { echo "#rcs -u2.1 failed"; exit 1; }
- X
- Xrm -f a.c &&
- Xco -l $q a.c &&
- Xcat >a.c <<'EOF' &&
- X2.2
- Xa
- Xb
- Xc
- Xd
- XEOF
- Xci -l -mm $q a.c &&
- Xco -p2.2 $q a.c | sed 's/2.2/2.3/; s/b/b1/' >a.c &&
- Xci -l -mm $q a.c &&
- Xco -p2.2 $q a.c | sed 's/2.2/new/; s/d/d1/' >a.c || exit 2
- Xrcsmerge -r2.2 -r2.3 $q a.c
- Xcase $? in
- X1) ;;
- X*) echo "#rcsmerge bad status"; exit 1
- Xesac
- Xdiff -c - a.c <<'EOF' || { echo "#rcsmerge failed"; exit 1; }
- X<<<<<<< a.c
- Xnew
- X=======
- X2.3
- X>>>>>>> 2.3
- Xa
- Xb1
- Xc
- Xd1
- XEOF
- X
- Xnl='
- X'
- Xif
- X co -p $q a.c | tr "$nl" "/" >a.c &&
- X ci -mm $q a.c
- Xthen
- X co -p $q a.c | tr "/" "$nl" >a.c &&
- X rcsdiff -c -r2.3 $q a.c || { echo "#trailing newline test failed"; exit 1; }
- Xelse
- X echo "#warning: Traditional diff is used, so RCS is limited to text files."
- X echo 'Keep rlog test happy.' >a.c && ci -mm $q a.c || exit
- Xfi
- X
- Xrlog -r2.1 a.c >a.t &&
- Xgrep '^checked in with -k' a.t >/dev/null &&
- Xsed '/^checked in with -k/d' a.t >a.u &&
- Xdiff -c - a.u <<EOF || { echo "#rlog failed"; exit 1; }
- X
- XRCS file: ${R}a.c,v
- XWorking file: a.c
- Xhead: 2.4
- Xbranch:
- Xlocks: strict
- Xaccess list:
- Xsymbolic names:
- X N: 2.1
- X n: 1.8
- Xcomment leader: ":::"
- Xkeyword substitution: kv
- Xtotal revisions: 14; selected revisions: 1
- Xdescription:
- X1.1
- X----------------------------
- Xrevision 2.1
- Xdate: $D $T; author: w; state: s; lines: +13 -1
- X=============================================================================
- XEOF
- X
- X
- Xexec rm -f a.* ${R}a.c,v
- X
- END_OF_FILE
- if test 8157 -ne `wc -c <'src/rcstest'`; then
- echo shar: \"'src/rcstest'\" unpacked with wrong size!
- fi
- chmod +x 'src/rcstest'
- # end of 'src/rcstest'
- fi
- echo shar: End of archive.
- exit 0
- exit 0 # Just in case...
-